
const webpack = require("webpack")
const htmlWebpackPlugin = require("html-webpack-plugin")
// const path = require("path")

module.exports = {
    mode: "development",
    entry: "./src/main.js",
    output: {
        filename: "bunder.js",
        // path: path.join(__dirname, "dist"),
    },
    devtool: "source-map",
    devServer: {
        // hotOnly: true
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ["style-loader", "css-loader"]
            },
            // {
            //     test: /\.js$/,
            //     use: {
            //         loader: "babel-loader",
            //         options: {
            //             presets: ["@babel/preset-env"]
            //         }
            //     }
            // },
            {
                test: /\.(png|jp?g|gif)$/,
                use: "file-loader"
            },
        ]
    },
    plugins: [
        new htmlWebpackPlugin({
            title: "Hot Module Replacement",
            template: "./src/index.html"
        }),
        // new webpack.HotModuleReplacementPlugin()
    ]
}